home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / ABSREAD.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  619 b   |  28 lines

  1. /* absread.c --- p 547 */
  2. #include <stdio.h>
  3. #include <dos.h>
  4. void main(void)
  5. {
  6.     int i, strt, ch_out, sector;
  7.     char buf[512];
  8.     printf("Insert a diskette into drive A and press any key\n");
  9.     getch();
  10.             /* Read logical sector 0. This "bootstrap"sector
  11.              * contains informtion about the disk's
  12.              * characteristics */
  13.     sector = 0;
  14.     if(absread(0,1,sector, &buf) != 0)
  15.     {
  16.         printf("Error in 'absread' !\n");
  17.         exit(0);
  18.     }
  19.     printf("Read OK.\n");
  20.     printf("OEM name and version from boot sector:\n");
  21.     strt = 3;
  22.     for(i=0;i<8;i++)
  23.     {
  24.         ch_out = buf[strt+i];
  25.         putchar(ch_out);
  26.     }
  27.     printf("\n");
  28. }